#!/bin/sh


# This script should be used to start Liferea
# to ensure a running DBUS session.

# default dist dir to <install root>/bin
dist_bin=@prefix@/bin

# autodetect alternate location when $0 provides information
if [ "`basename $0`" != "$0" ]; then
       dist_bin=`dirname $0`
fi

params="$@"

#
# If we run with Gecko or XulRunner we need to set 
# LD_LIBRARY_PATH (WebKit and GtkHTML do not need this).
#
if [ "@MOZILLA_LIB_ROOT@" != "" ]; then
	if [ "$LD_LIBRARY_PATH" = "" ]; then
		LD_LIBRARY_PATH=@MOZILLA_LIB_ROOT@
	else
		LD_LIBRARY_PATH=@MOZILLA_LIB_ROOT@:$LD_LIBRARY_PATH
	fi
	export LD_LIBRARY_PATH
fi

if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
	eval `dbus-launch`
	export DBUS_SESSION_BUS_ADDRESS
fi

exec $DEBUGGER "$dist_bin/liferea-bin" $params
